[XEN] Fix booting with dom0_mem specifying 4GB or more.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 12 Oct 2006 13:27:20 +0000 (14:27 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 12 Oct 2006 13:27:20 +0000 (14:27 +0100)
Signed-off-by: Charles Coffing <ccoffing@novell.com>
xen/arch/x86/domain_build.c

index 05b5c03c6381c16eed7231c54afd818ae5311c4d..f858adab51c17b9f10232ff62f82f9c957b00259 100644 (file)
@@ -401,11 +401,11 @@ int construct_dom0(struct domain *d,
            _p(dsi.v_start), _p(v_end));
     printk(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry));
 
-    if ( (v_end - dsi.v_start) > (nr_pages * PAGE_SIZE) )
+    if ( ((v_end - dsi.v_start)>>PAGE_SHIFT) > nr_pages )
     {
         printk("Initial guest OS requires too much space\n"
                "(%luMB is greater than %luMB limit)\n",
-               (v_end-dsi.v_start)>>20, (nr_pages<<PAGE_SHIFT)>>20);
+               (v_end-dsi.v_start)>>20, nr_pages>>(20-PAGE_SHIFT));
         return -ENOMEM;
     }